<template>
<div> 
    学校名称:{{name}},
    学校地址:{{address}}
 
</div>
</template>

<script>

   export default {
        name:  'School',
        props:['schoolName'],
        data(){
            return{
            name:"兰州理工大学",
            address:"甘肃"
            }
        },
        components: {},
        methods:{
         getDataFromStudent(data){
    console.log("我是school组件,我收到了值"+data);
    
         }
        },
    mounted() {
        //绑定一个自定义事件
        this.$bus.$on('test',this.getDataFromStudent);
    },
    beforeDestroy(){
        this.$bus.$off("test");
    }
   }
</script>

<style scoped>

</style>